package com.example.definedialog;

import com.example.definedialog.MyDialog.onClickDialogListener;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		
	}
	
	public void Click(View view){
		
		final MyDialog dialog=new MyDialog(MainActivity.this);
		dialog.initUI("提醒！！！", "是", "否");
		
//		dialog.setOnDialogClickListener(new onClickDialogListener() {
//			
//			@Override
//			public void onClickRightButton() {
//				// TODO Auto-generated method stub
//				Toast.makeText(MainActivity.this, "这是右边的button！", Toast.LENGTH_SHORT).show();
//			}
//			
//			@Override
//			public void onClickLeftButton() {
//				// TODO Auto-generated method stub
//				Toast.makeText(MainActivity.this, "这是左边的button！", Toast.LENGTH_SHORT).show();
//			}
//		});

		
		dialog.setOnDialogClickListener(new onClickDialogListener() {
			
			@Override
			public void onClickButton() {
				// TODO Auto-generated method stub
				Toast.makeText(MainActivity.this, "你点击了我", Toast.LENGTH_SHORT).show();
				dialog.closeDialog();
			}
		});
		
		dialog.showDialog();
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
